<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/public/js/jquery.md5.js"></script>

<?php if( !$this->userData ) { ?>
	<?php echo $this->inlineScript()->setScript('
	$(document).ready(function(){
		$.validator.setDefaults({
			submitHandler: function(e) { 
				var fields = $(e).find( "input.style5" );
				
				$("#login-form-box").animate({
					opacity: 0
				});
				$.post(
					baseUrl + "/index/login",
					{
						login : $( "#cemail" ).val(),
						password : $.md5( $( "#cpass" ).val() ),
						json : true
					},
					function( resp ){
						if( resp.status ) {
							window.location.reload();
						} else {
							alert( "' . $this->translate( 'error_login' ) . '" );
							$("#login-form-box").animate({
								opacity: 1
							});
						}
					},
					"json"
				);
			}
		});
	
		$("#login-form").validate({
			rules: {
				email : {
					required: true,
					email: true
				},
				pass : {
					required: true,
					minlength: 2
				}
			},
			messages: {
				email : "' . $this->translate( 'error_email' ) . '",
				pass : "'. $this->translate( 'error_password' ) .'"
			}
		});
	});
	') ?>
	
<div class="box nomtop login-form5" id="login-form-box" >

<h1><?php echo $this->translate( 'shop_bon_logowanie' ); ?></h1>

<form id="login-form" onsubmit="return false" method="post" action="">
<table class="tab">
	<tr>
		<td class="aright"><?php echo $this->translate( 'shop_bon_login' ); ?>:</td>
		<td><input type="text" name="email" value="" class="type5" id="cemail" ></td>
	</tr>
	<tr>
		<td class="aright"><?php echo $this->translate( 'shop_bon_pass' ); ?>:</td>
		<td><input type="password" id="cpass" name="pass" value="" class="type5"></td>
	</tr>
</table>
</form>

<div class="line" style="margin:10px 0"></div>

<div class="acenter">
<a href="javascript:;" class="button" onclick="$('#login-form').submit()"><?php echo $this->translate( 'shop_bon_logowanie' ); ?></a>
</div>

<div class="acenter" style="margin-top:20px">
<p>

	<a href="{baseUrl}/index/newaccount" class="orange"><?php echo $this->translate( 'basket_newaccount' ) ?></a> <span style="margin:0 10px">/</span> <a href="{baseUrl}/index/remindpass"><?php echo $this->translate( 'basket_remind' ) ?></a></p>
</div>

<div class="end"></div>

	
</div>
<?php } else { ?>
<div class="box nomtop">
	
	<h1><?php echo $this->translate( 'wishlist' ) ?></h1>
	
	<div class="desctext acenter">
    	<p>
    		<label class="ok"><?php echo $this->translate( 'wishlist_ok' ); ?></label>
    	</p>
	
		<div class="acenter">
			<a href="javascript:history.back(-1)" class="button" ><?php echo $this->translate( 'backinstock_backtoproduct' ); ?></a>
		</div>
	
	<div class="clr"></div>
	</div>
	
	<div class="end"></div>
</div>
<?php } ?>